package com.usefullc.blog.query;

import com.usefullc.common.enums.QueryExpressTypeEnum;
import com.usefullc.system.query.BaseQuery;
import com.usefullc.system.service.component.extend.UsefulQueryField;
import com.usefullc.system.validator.UsefulPropertyVerify;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 文章查询实体
 * @author: 星空
 * @date: 20220628
 */
@ApiModel
@Data
public class ArticleQuery extends BaseQuery {

//useful_auto_generate_section_start

    @UsefulQueryField()
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "类目")
    private Long categoryId;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=10)
    @ApiModelProperty(notes = "状态")
    private Integer status;

    @UsefulQueryField(type = QueryExpressTypeEnum.LIKE)
    @UsefulPropertyVerify(minLen=3, maxLen=100)
    @ApiModelProperty(notes = "标题")
    private String title;

    @UsefulQueryField()
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "作者")
    private Long userId;

    @UsefulQueryField(type = QueryExpressTypeEnum.GE, columnName = "gmtRelease")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "发布时间开始")
    private Date gmtReleaseStart;

    @UsefulQueryField(type = QueryExpressTypeEnum.LE, columnName = "gmtRelease")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "发布时间结束")
    private Date gmtReleaseEnd;

    @UsefulQueryField(type = QueryExpressTypeEnum.GE, columnName = "gmtAudit")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "审核时间开始")
    private Date gmtAuditStart;

    @UsefulQueryField(type = QueryExpressTypeEnum.LE, columnName = "gmtAudit")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "审核时间结束")
    private Date gmtAuditEnd;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=1)
    @ApiModelProperty(notes = "投稿")
    private Integer contribution;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=10)
    @ApiModelProperty(notes = "投稿状态")
    private Integer contributionStatus;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=1)
    @ApiModelProperty(notes = "原创")
    private Integer original;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=10)
    @ApiModelProperty(notes = "来源")
    private Integer source;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=1)
    @ApiModelProperty(notes = "开启回复")
    private Integer reply;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=1)
    @ApiModelProperty(notes = "置顶")
    private Integer top;

    @UsefulQueryField()
    @UsefulPropertyVerify(min=0, max=1)
    @ApiModelProperty(notes = "推荐")
    private Integer recommend;

    @UsefulQueryField(type = QueryExpressTypeEnum.IN,columnName = "categoryId")
    @UsefulPropertyVerify()
    @ApiModelProperty(notes = "类目ID集合")
    private List<Long> categoryIds;


//useful_auto_generate_section_end

    @UsefulQueryField(columnName = "gmtCreate", format = "%Y-%m-%d %H:%i:%s",type= QueryExpressTypeEnum.LT)
    @ApiModelProperty(notes = "创建时间开始")
    private String gmtCreateSecondStart;

    @UsefulQueryField(columnName = "gmtCreate", format = "%Y-%m-%d %H:%i:%s",type= QueryExpressTypeEnum.GT)
    @ApiModelProperty(notes = "创建时间结束")
    private String gmtCreateSecondEnd;




}
